﻿using System;
using System.Collections.Generic;

namespace _03.AnimalHierarchy
{
    class Program
    {
        static void Main(string[] args)
        {          
            Frog[] frogs =
            {
                new Frog( 2, "Frog1", "female"),
                new Frog( 8, "Frog2", "female"),
                new Frog( 6, "Frog3", "female"),
                new Frog( 7, "Frog4", "female")
            };

            Console.WriteLine("Printing frogs");

            foreach (var frog in frogs)
            {
                Console.WriteLine(frog);
            }

            Dog[] dogs =
            {
                new Dog( 4, "Dog1", "female"),
                new Dog( 7, "Dog2", "female"),
                new Dog( 8, "Dog3", "female"),
                new Dog( 10, "Dog4", "female")
            };

            Console.WriteLine();
            Console.WriteLine("Printing frogs");

            foreach (var dog in dogs)
            {
                Console.WriteLine(dog);
            }

            List<Animal> frogList = new List<Animal>(frogs);
            List<Animal> dogList = new List<Animal>(dogs);

            Console.WriteLine(Animal.Average(frogList));
            Console.WriteLine(Animal.Average(dogList));

        }
    }
}
